package com.splunk.hiring.imov.entity.dto;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.splunk.hiring.imov.entity.Movie;
import com.splunk.hiring.imov.entity.convertor.GenreListConvertor;

public class MovieDTO {
	int index;
	Movie movie;
	
	public MovieDTO(int index, Movie movie) {
		super();
		this.index = index;
		this.movie = movie;
	}
	public int getIndex() {
		return index;
	}
	public String getId() {
		return Long.toString(movie.getId());
	}
	public String getTitle() {
		return movie.getTitle();
	}
	public String getGenres() {
		String genres = movie.getGenres();
		if(null == genres){
			return "";
		} else {
			return genres;
		}
	}
	public Integer getRateCount() {
		return movie.getMovieInfo().getRateCount();
	}
	public Float getAverageRate() {
		return movie.getMovieInfo().getAverageRate();
	}
}
